﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MvcApplication1.Models
{
    public class CartFactory
    {
        public Cart GetCart()
        {
            Cart c = new Cart();
            c.Header = new OrderHeader();

            c.Header.Account = new Account()
            {
                Email = "asiemer@hotmail.com",
                FirstName = "Andrew",
                LastName = "Siemer",
                Username = "asiemer"
            };

            c.Header.Billing = new Address()
            {
                City = "Lancaster",
                State = "CA",
                Street1 = "Some Street",
                Street2 = "Apt 2",
                Zip = 93536
            };

            c.Header.Shipping = new Address()
            {
                City = "Fresno",
                State = "CA",
                Street1 = "This street",
                Street2 = "Front step",
                Zip = 93536
            };
            List<LineItem> items = new List<LineItem>();
            for (int i = 0; i < 10; i++)
            {
                Product p = new Product();
                p.Name = "Product " + i;
                p.Price = 2 * i;
                p.Tax = .0875;

                LineItem li = new LineItem();
                li.Product = p;
                li.Quantity = i;

                items.Add(li);
            }

            c.Items = items;
            return c;
        }
    }
}